﻿<!DOCTYPE html>
<html page="default_MyDesktop">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>个人桌面</title>
    <link href="~/Content/css/framework-font.css" rel="stylesheet" />
    <link href="~/Content/css/framework-ui.css" rel="stylesheet" />
    <script src="~/Content/js/jquery/jquery-2.1.1.min.js"></script>
    <link href="~/Content/css/framework-theme.css" rel="stylesheet" />
    <link href="~/Content/js/bootstrap/bootstrap.min.css" rel="stylesheet" />
    <link href="~/Content/css/framework-theme.css" rel="stylesheet" />
    <script src="~/Content/js/jqgrid/jqgrid.min.js"></script>
    <script src="~/Content/js/framework-ui.js"></script>
    <script>
        function upde() {
            $.ajax({
                url: "../Default/GetSession",
                async: false,
                success: function (data) {

                }
            });
        }
        $(function () {
            GetCollect();
            GetAnnounce();
            GetDaiBan();
            BirthTx();
            GetFWDT();
            //桌面权限
            var keyValue = $("#userName").val();
            if (keyValue == "admin") {
                var adminVal = "|NF-BirthTXcounts|NF-BirthTXcount";
                var slt = adminVal.split("|").length;
                for (var i = 1; i < slt; i++) {
                    var sltId = adminVal.split("|")[i];

                    if (sltId = "NF-BirthTXcount") {
                        $("#NF-BirthTXcounts").css("display", "");
                    }
                    if (sltId = "NF-BirthTXcount") {
                        $("#NF-BirthTXcount").css("display", "");
                    }
                }
            }
            else {
                $("#NF-BirthTXcounts").css("display", "");
                $.ajax({
                    url: "../Default/ZmqxList?roleId=" + keyValue,
                    dataType: "json",
                    async: false,
                    success: function (data) {
                        if (data != "" && data != null) {
                            data = "|NF-BirthTXcounts" + data;
                            var slt = data.split("|").length;
                            var Html = "";
                            for (var i = 1; i < slt; i++) {
                                var sltId = data.split("|")[i];
                                if (sltId = "NF-BirthTXcounts") {
                                    $("#NF-BirthTXcounts").css("display", "");
                                }
                                if (sltId = "NF-BirthTXcount") {
                                    $("#NF-BirthTXcount").css("display", "");
                                }
                            }
                        }
                    }
                });
            }
            $('.menuItem').on('click', top.$.nfinetab.addTab);
            setInterval(upde, 60000);
            var aLth = $("#NF-FWDT>div").children("a").length;
            $("#NF-FWDT>div").width(aLth * 95 + 15);
        });
        //服务大厅
        function GetFWDT() {
            $.ajax({
                url: "../Default/GetFWDTCollect",
                dataType: "json",
                async: false,
                success: function (data) {
                    $("#FWDT").html(data);
                }
            });
        }
        //常用功能
        function GetCollect() {
            $.ajax({
                url: "../Default/GetCollect",
                dataType: "json",
                async: false,
                success: function (data) {
                    $("#CYList").html(data);
                }
            });
        }
        //获取通知
        function GetAnnounce() {
            $.ajax({
                url: "../Default/GetAnnounceJson",
                dataType: "json",
                async: false,
                success: function (data) {
                    $("#PTList").html(data);
                }
            });
        }
        //待办事务（线上业务审批）
        function GetDaiBan() {
            $.ajax({
                url: "../Default/GetXSYW",
                dataType: "json",
                async: false,
                success: function (data) {
                    $("#XSYW").html(data);
                }
            })
        }
        //待办事务审批
        function btn_daiban(id, doc_bill_bilcode, doc_bill_user, state) {
            $.modalOpen({
                title: "线上业务审批",
                url: "/XSYW/lcbdfb/Form?id=" + id + "&state=1",
                width: "1000px",
                height: "650px",
                btn: ['转交下一步', '关闭'],
                callBack: function (iframeId) {
                    top.layer.closeAll()
                    $.modalOpen({
                        title: "审批",
                        url: encodeURI(encodeURI("/PersonnelOffice/SchoolLeave/ProcessApproval?billcode=" + doc_bill_bilcode + "&vname=" + doc_bill_user + "&vstate=" + state + "&tablename=Detail_doc_bill")),
                        width: "800px",
                        height: "600px",
                        btn: ["", '关闭'],
                        btnclass: ["", 'btn btn-danger'],
                        callBack: function (iframeId) {
                            top.frames[iframeId].submitForm();
                        }
                    });
                }
            });
        }
        //通知弹窗
        function btn_Announce(id, title) {
            $.modalOpen({
                title: "通告标题：" + title + "",
                url: "/Notice/Noticeselete/Form?id=" + id,
                width: "1200px",
                height: "680px",
                btn: ['', '关闭'],
                btnclass: ['', 'btn btn-danger'],
                callBack: function (iframeId) {
                    top.frames[iframeId].exportForm();
                }
            });
        }


        //生日提醒
        function BirthTx() {
            $.ajax({
                url: "../Default/GetBirthTXCount",
                dataType: "json",
                async: false,
                success: function (data) {
                    $("#NF-BirthTXcount .menuItem").append("（" + data + "）");
                }
            })
        }
        //点击关闭
        function xx() {
            $("#winpop").hide();
        }
        //获取提示信息
        function ts() {
            $.ajax({
                url: "../Default/GetXJRYSP",
                dataType: "json",
                data: "",
                async: false,
                success: function (data) {
                    if (data == null) {
                        $("#winpop").hide();
                    } else {
                        $("#winpop").show();
                    }
                    var html = "<tbody>";
                    var s = 1;
                    for (var i = 0; i < data.length; i++) {
                        if (data[i].app_names != null) {
                            html += "<tr title='点击查看'><td style='text - align: left; height: 18px; '>" + s + "：<a class='menuItem' data-id='" + data[i].dataid + "'  href='" + data[i].url + "'> " + data[i].app_names + "</a>" + "(" + data[i].Column1 + ")</td></tr>";
                            s++
                        }
                    }
                    html += "</tbody>";
                    $("#table").html(html);
                }
            });
        }
    </script>
    <style type="text/css">
        a.fff {
            text-decoration: none;
            float: left;
            margin-left: 10px
        }

        .yyimg {
            line-height: 40px;
            border-radius: 6px;
            color: white;
            font-size: 18px;
            text-align: center;
            border: 0;
            vertical-align: middle;
            background-color: #007bff;
            margin: 0 auto;
        }

        #theme-wrapper {
            margin-bottom: 20px;
        }

        .panel-default {
            border: none;
            border-radius: 0px;
            margin-bottom: 0px;
            box-shadow: none;
            -webkit-box-shadow: none;
        }

            .panel-default > .panel-heading {
                height: 26px;
                line-height: 26px;
                color: #084b80;
                background-color: #fff;
                border-color: #95B8E7;
                padding: 0;
                padding-left: 10px;
                font-family: SimSun;
                font-weight: bold;
                font-size: 12px;
                background-color: #e4efff;
            }

            .panel-default > .panel-body {
                padding: 10px;
                padding-bottom: 0px;
                font-size: 13px;
                font-family: SimSun;
            }

                .panel-default > .panel-body ul {
                    overflow: hidden;
                    padding: 0;
                    margin: 0px;
                    margin-top: -5px;
                }

                    .panel-default > .panel-body ul li {
                        line-height: 24px;
                        list-style-type: none;
                        white-space: nowrap;
                        text-overflow: ellipsis;
                    }

                        .panel-default > .panel-body ul li .time {
                            color: #a1a1a1;
                            float: right;
                            padding-right: 5px;
                        }

        .winpop {
            position: absolute;
            bottom: 2px;
            right: 15px;
            width: 300px;
            height: 300px;
            display: block;
            background-color: #fff;
            border: 1px solid #ccc;
        }

            .winpop .title {
                text-align: left;
                line-height: 32px;
                color: #084b80;
                font-family: SimSun;
                font-weight: bold;
                font-size: 12px;
            }
    </style>
</head>
<body>
    <input id="userName" value="@ViewBag.UserNum" type="hidden" />
    <input id="SRcount" value="" type="hidden" />
    <input id="TXTXcount" value="" type="hidden" />
    <input id="HTcount" value="" type="hidden" />
    <input id="XJTXcount" value="" type="hidden" />
    <input id="BYRZcount" value="" type="hidden" />
    <input id="BDDQcount" value="" type="hidden" />
    <input id="YJFKcount" value="" type="hidden" />
    <div id="theme-wrapper" style="margin-bottom: 20px;">
        <div class="rows" style="margin-bottom: 1%; overflow: hidden;">
            <div class="col-md-12">
                <div style="overflow:hidden; height: 133px; border: 1px solid #95B8E7;border-radius:6px; overflow:hidden;background-color: #fff;width:100%;">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            服务大厅
                        </div>
                        <div class="panel-body" id="NF-FWDT" style="padding-bottom: 0px;width:100%;overflow-x:auto;height: 108px;">
                            <div style="width: 100%; padding-right: 10px;" id="FWDT">

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="rows" style="margin-bottom: 1%; overflow: hidden;">
            <div class="col-md-6">
                <div style="height: 235px; border: 1px solid #95B8E7;border-radius:6px; overflow:hidden;background-color: #fff;">
                    <div class="panel panel-default">
                        <div class="panel-heading">

                            待办事项

                        </div>
                        <div class="panel-body" id="NF-XSYW" style="padding-bottom: 0px">
                            <div id="NF-BirthTXcounts" style="display:none">
                                <a class='menuItem' href="../PersonnelOffice/Roster/Index_CZSC">新人入职填表须知</a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-md-6">
                <div style="height: 235px; border: 1px solid #95B8E7; border-radius:6px;overflow:hidden;background-color: #fff;">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            消息提醒
                        </div>
                        <div class="panel-body" id="NF-XXTX" style="height: 250px; width: 100%;">

                            <div id="NF-BirthTXcount" style="display:none">
                                <a class='menuItem' href="../RSK/BirthdayReminder/Index">员工生日提醒</a>
                            </div>


                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="rows" style="overflow: hidden;">
            <div class="col-md-6">
                <div style="height: 235px; border: 1px solid #95B8E7; border-radius: 6px; overflow: hidden; background-color: #fff;">
                    <div class="panel panel-default">
                        <div class="panel-heading">

                            通知公告
                        </div>
                        <div class="panel-body" id="NF-PTList">
                            <div id="PTList"></div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-md-6">
                <div style="height: 235px; border: 1px solid #95B8E7; border-radius: 6px; overflow: hidden; background-color: #fff;">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            常用功能
                        </div>
                        <div class="panel-body" id="NF-CYList">
                            <div id="CYList">
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>
        <div class="rows" style="overflow: hidden;">


        </div>
    </div>

</body>
</html>